distribution: fix epel repo metalinks#4108
Conversation
mkosi/distribution/centos.py
Outdated
| if GenericVersion(context.config.release) >= 10: | ||
| repo_extra_part = "-z" | ||
| else: | ||
| repo_extra_part = "" |
There was a problem hiding this comment.
We can shorten this a bit
| if GenericVersion(context.config.release) >= 10: | |
| repo_extra_part = "-z" | |
| else: | |
| repo_extra_part = "" | |
| repo_extra_part = "-z" if GenericVersion(context.config.release) >= 10 else "" |
There was a problem hiding this comment.
Good point, I forgot about ternary expressions. Will fix that.
mkosi/distribution/centos.py
Outdated
| else: | ||
| url = "metalink=https://mirrors.fedoraproject.org/metalink?arch=$basearch" | ||
|
|
||
| if GenericVersion(context.config.release) >= 10: |
There was a problem hiding this comment.
What happens when 11 is released? It'll use the -z suffix as well then, which it probably shouldn't?
There was a problem hiding this comment.
I think there are some version parsing functions already in use in the code somewhere, I will see if I can just use those to check for the presence of a minor version.
I think this could already be a problem with just version 10 alone, but that never worked in my tests before (it tries to mix Rocky's 10.1 and EPEL's 10.2 repos and fails) so I can't really confirm.
mkosi/distribution/centos.py
Outdated
| yield RpmRepository( | ||
| "epel-testing", | ||
| f"{url}&repo=testing-epel{release}", | ||
| f"{url}&repo=epel{repo_extra_part}-testing-{release}", | ||
| gpgurls, | ||
| enabled=False, | ||
| ) | ||
| yield RpmRepository( | ||
| "epel-testing-debuginfo", | ||
| f"{url}&repo=testing-debug-epel{release}", | ||
| f"{url}&repo=epel{repo_extra_part}-testing-debug-{release}", | ||
| gpgurls, | ||
| enabled=False, | ||
| ) | ||
| yield RpmRepository( | ||
| "epel-testing-source", | ||
| f"{url}&repo=testing-source-epel{release}", | ||
| f"{url}&repo=epel{repo_extra_part}-testing-source-{release}", | ||
| gpgurls, | ||
| enabled=False, | ||
| ) |
There was a problem hiding this comment.
Have you double checked this also works with centos 9?
There was a problem hiding this comment.
I did not think to test older versions, that is a good point. Is there and existing test suite I can just run to check this specific thing or should I write my own? Also if I have to write my own (I am assuming a handful of mkosi.conf files is enough) is there a good place to put that, so that future problems can be detected sooner?
There was a problem hiding this comment.
The integration test system is in dire need of a revamp, so a manual test will suffice for now.
|
The GitHub diff is a bit confusing, so I will try to explain the changes: I moved all existing metalink entries into an if that checks if the major release is below 10. I removed the two smaller checks for the same, both for epel-next, since they are now redundant. I then added a separate else branch for release 10 and above that yields the new metalinks. I renamed the repo_extra_part variable to minor_version_flag to better reflect the meaning and used a small regex to detect if a minor version is present. The minor version regex is the part I am most unsure about. |
Replaces systemd#4108 The previous PR didn't take into account that mirrors were changed as well. This PR should cover all changes in RHEL 10 to how EPEL is handled.
|
Replaced by #4161 |
Replaces #4108 The previous PR didn't take into account that mirrors were changed as well. This PR should cover all changes in RHEL 10 to how EPEL is handled.
This commit fixes the EPEL repository meta-links.
There where two problems:
10.1instead of just10)The links can be confirmed by looking in the
/etc/yum.repos.d/epel.repoand/etc/yum.repos.d/epel-testing.repofiles on a system with theepel-releasepackage installed.The changes can be tested with this
mkosi.conf: